import pygame, sys
from pygame.locals import *

# set up pygame
pygame.init()
mainClock = pygame.time.Clock()

S_WIDTH = 640
S_HEIGHT = 480

# set up the window
windowSurface = pygame.display.set_mode((S_WIDTH, S_HEIGHT), 0, 32)
pygame.display.set_caption('ch2_6')

BLACK = (0, 0, 0)

GIRL_W = 640
GIRL_H = 480

girlRect = pygame.Rect(0, 0, GIRL_W, GIRL_H)
girls = []
for i in range(7):
    girls.append(pygame.image.load('girl%d.bmp' % i))
cur = 0

while True:
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()

    windowSurface.blit(girls[cur], girlRect)
    cur = (cur+1, 0)[cur == 6]
    pygame.display.update()
    mainClock.tick(5)
